package com.inno.auth.domain.config;

import com.inno.auth.domain.feign.FeignProperties;
import com.inno.auth.domain.feign.FeignRequestInterceptor;
import feign.Retryer;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration

public class FeignConfig {
    @Resource
    private  FeignProperties feignProperties;

    @Bean
    public Retryer retryer(){
        return new Retryer.Default(1000,1000,3);
    }

    @Bean
    public FeignRequestInterceptor feignRequestInterceptor(){
        return new FeignRequestInterceptor(feignProperties);
    }
}
